custom_build: build output goes in the directory for the req, not hard coded to Target
authorCody P Schafer <dev@codyps.com>
Fri, 5 Dec 2014 06:54:33 +0000 (01:54 -0500)
committerCody P Schafer <dev@codyps.com>
Fri, 5 Dec 2014 07:01:02 +0000 (02:01 -0500)
This broke crossbuilds that had Host deps that used custom build
scripts, typically resulting in a failure to link (due to bad
relocations or symbols) the final executable or library.

Probably should have rustc check when generating an rlib that all the
containing objects have the appropriate arch.

src/cargo/ops/cargo_rustc/custom_build.rs

index 07ccbaf5f77bdd0be24ee46410d136323a75fc50..ed03074861c6e1970bc15cb7acfe7d24b9cefb6c 100644 (file)
@@ -39,7 +39,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform,
     let kind = match req { Platform::Plugin => Kind::Host, _ => Kind::Target, };
     let (script_output, build_output) = {
         (cx.layout(pkg, Kind::Host).build(pkg),
-         cx.layout(pkg, Kind::Target).build_out(pkg))
+         cx.layout(pkg, kind).build_out(pkg))
     };
 
     // Building the command to execute